package com.example.day12;

/**
 * @author Lenovo
 */
public class Object {
    class Student extends Object {
        private String name;
        private int age;
       public Student(){}
        public Student(String name,int age){
            this.name=name;
            this.age=age;
        }
        public String getName(){
            return name;
        }
        public void setName(String name){
            this.name=name;
        }
        public int getAge(){
            return age;
        }
        public void setAge(int age){
            this.age=age;
        }
        @Override
        public String toString(){
            return "Student{name="+name+",age="+age+"}";
        }
    }
    public class ObjectDemo {
        public void main(String[] args)
        {
            Student s = new Student();
            s.setName("林青霞");
            s.setAge(30);
            System.out.println(s.getName()+"---"+s.getAge());
            System.out.println(s);
            System.out.println(s.toString());
        }
    }
}
